package com.linkwechat.wecom.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.linkwechat.wecom.domain.WeworkKfMemberRelation;
import com.linkwechat.wecom.mapper.WeworkKfMemberRelationMapper;
import com.linkwechat.wecom.service.IWeworkKfMemberRelationService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;


import java.util.List;

/**
 * 企微客服userId与助销宝member_id桥接Service业务层处理
 *
 * @author ruoyi
 * @date 2022-05-19
 */
@Service
public class WeworkKfMemberRelationServiceImpl extends ServiceImpl<WeworkKfMemberRelationMapper, WeworkKfMemberRelation> implements IWeworkKfMemberRelationService {

    @Override
    public List<WeworkKfMemberRelation> queryList(WeworkKfMemberRelation weworkMemberRelation) {
        LambdaQueryWrapper<WeworkKfMemberRelation> lqw = Wrappers.lambdaQuery();
        if (weworkMemberRelation.getMemberId() != null){
            lqw.eq(WeworkKfMemberRelation::getMemberId ,weworkMemberRelation.getMemberId());
        }
        if (weworkMemberRelation.getUserid() != null){
            lqw.eq(WeworkKfMemberRelation::getUserid ,weworkMemberRelation.getUserid());
        }
        return this.list(lqw);
    }
}
